package firstTestHomework;

import org.junit.Test;

public class tests {
	@Test
	public void test() {
		Teacher teacher1 = new Teacher();
		Teacher teacher2 = new Teacher();
	}
	
	@Test
	public void string() {
		String str1 = "abc";
		String str2 = new String("abc");
		String str3 = "abc";
		String string = new String("Abc");
		
		System.out.println(str1 == str2);
		System.out.println(str1 == str3);
		System.out.println(str2 == str3);
		System.out.println(str1 == string);
		System.out.println(str1.equals(string));
		System.out.println(str1.equalsIgnoreCase(string));
	}
	
	@Test
	public void com() {
		String str = "Java AndroidA";
		System.out.println(str.length());
		char[] array = str.toCharArray();
		char ch = str.charAt(5);
		System.out.println(ch);
		System.out.println(str.indexOf('A'));
		System.out.println(str.indexOf('x'));
		System.out.println(str.indexOf('A', 6));
		System.out.println(str.indexOf("And"));
		System.out.println(str.lastIndexOf('A'));
		System.out.println("------------------------");
		System.out.println(str.contains("And"));
		System.out.println(str.startsWith("An"));
		System.out.println(str.startsWith("And", 5));
		System.out.println(str.endsWith("oidA"));
		System.out.println(str.isEmpty());
		System.out.println("".isEmpty());
		System.out.println("++++++++++++++");
		String str2 = " java AndroidA  ";
		System.out.println(str2);
		System.out.println(str2.trim());
		System.out.println(str.substring(5));
		System.out.println(str.substring(5,8));
		String newstr = str.replace('A', 'B');
		System.out.println(str);
		System.out.println(newstr);
		
		String stre = "java Android python";
		String[] array1 = stre.split(" ");
		for(String strew:array1) {
			System.out.println(strew);
		}
	}
	
}
